home *** CD-ROM | disk | FTP | other *** search
/ Introducing the New Way to Shop From Home / Introducing the New Way to Shop From Home (Iceland Foods) (2003).iso / pc / MacStepbyStep.dxr / Internal_195_update button 2.ls < prev    next >
Encoding:
Text File  |  2003-01-01  |  11.7 KB  |  254 lines

  1. on mouseDown
  2.   global gQuantity2, gQuantityTotal2, gCost2, gTotalCost, gChickenSaving, gBreadSaving, gSugarSaving, gTotalSaving, gProductTypes, gList1Quant, gList1Prod, gList1Cost, gList1Total, gList2Quant, gList2Prod, gList2Cost, gList2Total, gList3Quant, gList3Prod, gList3Cost, gList3Total, gList4Quant, gList4Prod, gList4Cost, gList4Total, gList5Quant, gList5Prod, gList5Cost, gList5Total, gList6Quant, gList6Prod, gList6Cost, gList6Total, gList7Quant, gList7Prod, gList7Cost, gList7Total, gList8Quant, gList8Prod, gList8Cost, gList8Total, gList9Quant, gList9Prod, gList9Cost, gList9Total, gList10Quant, gList10Prod, gList10Cost, gList10Total, gList11Quant, gList11Prod, gList11Cost, gList11Total, gList12Quant, gList12Prod, gList12Cost, gList12Total, gList13Quant, gList13Prod, gList13Cost, gList13Total
  3.   if gQuantity2 = member(70).text then
  4.     nothing()
  5.   else
  6.     set the floatPrecision to 0
  7.     gQuantity2 = member(70).text
  8.     gQuantity2 = integer(gQuantity2)
  9.   end if
  10.   if gList2Prod = string("Tate & Lyle Granulated Sugar") then
  11.     set the floatPrecision to 2
  12.     member(204).text = string(gSugarSaving)
  13.   else
  14.     if gList2Quant = 0 then
  15.       nothing()
  16.     else
  17.       if gQuantity2 > 0 then
  18.         set the floatPrecision to 2
  19.         if gList2Prod = string("Iceland 10 (1.6kg) Chicken Drumsticks") then
  20.           gCost2 = gQuantity2 / 2 * 4.0
  21.           if (gQuantity2 mod 2) = 0 then
  22.             gChickenSaving = gQuantity2 * 0.48999999999999999
  23.           else
  24.             gCost2 = gCost2 + 2.49000000000000021
  25.             gChickenSaving = (gQuantity2 - 1) * 0.48999999999999999
  26.           end if
  27.           gTotalSaving = gChickenSaving + gBreadSaving + gSugarSaving
  28.           gList2Quant = gQuantity2
  29.           gList2Total = gCost2
  30.           gTotalCost = gList1Total + gList2Total + gList3Total + gList4Total + gList5Total + gList6Total + gList7Total + gList8Total + gList9Total + gList10Total + gList11Total + gList12Total + gList13Total
  31.           member(74).text = string(gList2Quant & "x")
  32.           member(92).text = gList2Prod
  33.           member(94).text = string("¬£" & gList2Total)
  34.           member(105).text = string("¬£" & gTotalSaving)
  35.           member(150).text = string("¬£" & gTotalCost)
  36.           member(204).text = string(gChickenSaving)
  37.         else
  38.           set the floatPrecision to 2
  39.           if gList2Prod = string("Kingsmill 800g Wmeal Bread") then
  40.             gCost2 = gQuantity2 / 2 * 1.0
  41.             if (gQuantity2 mod 2) = 0 then
  42.               gBreadSaving = gQuantity2 * 0.14999999999999999
  43.             else
  44.               gCost2 = gCost2 + 0.65000000000000002
  45.               gBreadSaving = (gQuantity2 - 1) * 0.14999999999999999
  46.             end if
  47.             gTotalSaving = gChickenSaving + gBreadSaving + gSugarSaving
  48.             gList2Quant = gQuantity2
  49.             gList2Total = gCost2
  50.             gTotalCost = gList1Total + gList2Total + gList3Total + gList4Total + gList5Total + gList6Total + gList7Total + gList8Total + gList9Total + gList10Total + gList11Total + gList12Total + gList13Total
  51.             member(74).text = string(gList2Quant & "x")
  52.             member(92).text = gList2Prod
  53.             member(94).text = string("¬£" & gList2Total)
  54.             member(105).text = string("¬£" & gTotalSaving)
  55.             member(150).text = string("¬£" & gTotalCost)
  56.             member(204).text = string(gBreadSaving)
  57.           else
  58.             set the floatPrecision to 2
  59.             gCost2 = gQuantity2 * gList2Cost
  60.             gList2Quant = gQuantity2
  61.             gList2Total = gCost2
  62.             gTotalCost = gList1Total + gList3Total + gList4Total + gList5Total + gList6Total + gList7Total + gList8Total + gList9Total + gList10Total + gList11Total + gList12Total + gList13Total + (gQuantity2 * gList2Cost)
  63.             member(74).text = string(gList2Quant & "x")
  64.             member(92).text = gList2Prod
  65.             member(94).text = string("¬£" & gList2Total)
  66.             member(150).text = string("¬£" & gTotalCost)
  67.             member(204).text = string("0.00")
  68.           end if
  69.         end if
  70.       else
  71.         if gList2Prod = string("Iceland 10 (1.6kg) Chicken Drumsticks") then
  72.           gChickenSaving = 0.0
  73.         else
  74.           if gList2Prod = string("Kingsmill 800g Wmeal Bread") then
  75.             gBreadSaving = 0.0
  76.           else
  77.             nothing()
  78.           end if
  79.         end if
  80.         set the floatPrecision to 2
  81.         gTotalSaving = gChickenSaving + gBreadSaving + gSugarSaving
  82.         member(105).text = string("¬£" & gTotalSaving)
  83.         gProductTypes = gProductTypes - 1
  84.         member(104).text = string(gProductTypes)
  85.         gList2Quant = gList3Quant
  86.         gList2Prod = gList3Prod
  87.         gList2Cost = gList3Cost
  88.         gList2Total = gList3Total
  89.         gList3Quant = gList4Quant
  90.         gList3Prod = gList4Prod
  91.         gList3Cost = gList4Cost
  92.         gList3Total = gList4Total
  93.         gList4Quant = gList5Quant
  94.         gList4Prod = gList5Prod
  95.         gList4Cost = gList5Cost
  96.         gList4Total = gList5Total
  97.         gList5Quant = gList6Quant
  98.         gList5Prod = gList6Prod
  99.         gList5Cost = gList6Cost
  100.         gList5Total = gList6Total
  101.         gList6Quant = gList7Quant
  102.         gList6Prod = gList7Prod
  103.         gList6Cost = gList7Cost
  104.         gList6Total = gList7Total
  105.         gList7Quant = gList8Quant
  106.         gList7Prod = gList8Prod
  107.         gList7Cost = gList8Cost
  108.         gList7Total = gList8Total
  109.         gList8Quant = gList9Quant
  110.         gList8Prod = gList9Prod
  111.         gList8Cost = gList9Cost
  112.         gList8Total = gList9Total
  113.         gList9Quant = gList10Quant
  114.         gList9Prod = gList10Prod
  115.         gList9Cost = gList10Cost
  116.         gList9Total = gList10Total
  117.         gList10Quant = gList11Quant
  118.         gList10Prod = gList11Prod
  119.         gList10Cost = gList11Cost
  120.         gList10Total = gList11Total
  121.         gList11Quant = gList12Quant
  122.         gList11Prod = gList12Prod
  123.         gList11Cost = gList12Cost
  124.         gList11Total = gList12Total
  125.         gList12Quant = gList13Quant
  126.         gList12Prod = gList13Prod
  127.         gList12Cost = gList13Cost
  128.         gList12Total = gList13Total
  129.         gList13Quant = 0
  130.         gList13Prod = "none"
  131.         gList13Cost = 0
  132.         gList13Total = 0
  133.         gTotalCost = gList1Total + gList2Total + gList3Total + gList4Total + gList5Total + gList6Total + gList7Total + gList8Total + gList9Total + gList10Total + gList11Total + gList12Total + gList13Total
  134.         member("productp21_blank2").image = member("productp21_blank3").image
  135.         member("productp21_blank3").image = member("productp21_blank4").image
  136.         member(204).text = member(205).text
  137.         member(205).text = member(206).text
  138.         if gList4Prod = string("Iceland 9" & numToChar(34) & " Pep & Ham D/Pan Pizza") then
  139.           member("productp21_blank4").image = member("productp21_pizpep").image
  140.           member(206).text = string("0.00")
  141.         else
  142.           if gList4Prod = string("Iceland 9" & numToChar(34) & " Veg Fst T/Crispy Pizza") then
  143.             member("productp21_blank4").image = member("productp21_pizveg").image
  144.             member(206).text = string("0.00")
  145.           else
  146.             if gList4Prod = string("Iceland 9" & numToChar(34) & " Char Ckn T/Crispy Pizza") then
  147.               member("productp21_blank4").image = member("productp21_pizchar").image
  148.               member(206).text = string("0.00")
  149.             else
  150.               if gList4Prod = string("Iceland 9" & numToChar(34) & " Chse Melt D/Pan Pizza") then
  151.                 member("productp21_blank4").image = member("productp21_pizchee").image
  152.                 member(206).text = string("0.00")
  153.               else
  154.                 if gList4Prod = string("Iceland 10" & numToChar(34) & " Mt Comb S/Crust Pizza") then
  155.                   member("productp21_blank4").image = member("productp21_pizcom").image
  156.                   member(206).text = string("0.00")
  157.                 else
  158.                   if gList4Prod = string("Iceland 10 (1.6kg) Chicken Drumsticks") then
  159.                     member("productp21_blank4").image = member("productp21_drum").image
  160.                     member(206).text = string(gChickenSaving)
  161.                   else
  162.                     if gList4Prod = string("Birds Eye 4 Beef Quarter Pounders") then
  163.                       member("productp21_blank4").image = member("productp21_beefburg").image
  164.                       member(206).text = string("0.00")
  165.                     else
  166.                       if gList4Prod = string("Iceland 2 Jumbo Haddock Fillets") then
  167.                         member("productp21_blank4").image = member("productp21_haddock").image
  168.                         member(206).text = string("0.00")
  169.                       else
  170.                         if gList4Prod = string("Napolina 400g Chopped Tomatoes") then
  171.                           member("productp21_blank4").image = member("productp21_toms").image
  172.                           member(206).text = string("0.00")
  173.                         else
  174.                           if gList4Prod = string("Iceland 500g Pasta Shells") then
  175.                             member("productp21_blank4").image = member("productp21_pasta").image
  176.                             member(206).text = string("0.00")
  177.                           else
  178.                             if gList4Prod = string("Kingsmill 800g Wmeal Bread") then
  179.                               member("productp21_blank4").image = member("productp21_bread").image
  180.                               member(206).text = string(gBreadSaving)
  181.                             else
  182.                               if gList4Prod = string("Tate & Lyle Granulated Sugar") then
  183.                                 member("productp21_blank4").image = member("productp21_sugar").image
  184.                                 member(206).text = string(gSugarSaving)
  185.                               else
  186.                                 member("productp21_blank4").image = member("productp21_blank").image
  187.                               end if
  188.                             end if
  189.                           end if
  190.                         end if
  191.                       end if
  192.                     end if
  193.                   end if
  194.                 end if
  195.               end if
  196.             end if
  197.           end if
  198.         end if
  199.       end if
  200.       member(79).text = string(gList1Quant & "x")
  201.       member(75).text = gList1Prod
  202.       member(80).text = string("¬£" & gList1Total)
  203.       member(150).text = string("¬£" & gTotalCost)
  204.       if gList2Quant = 0 then
  205.         member(74).text = string(EMPTY)
  206.         member(92).text = EMPTY
  207.         member(94).text = string(EMPTY)
  208.         sprite(69).visible = 1
  209.       else
  210.         member(74).text = string(gList2Quant & "x")
  211.         member(92).text = gList2Prod
  212.         member(94).text = string("¬£" & gList2Total)
  213.       end if
  214.       if gList3Quant = 0 then
  215.         member(89).text = string(EMPTY)
  216.         member(91).text = EMPTY
  217.         member(158).text = string(EMPTY)
  218.         sprite(70).visible = 1
  219.       else
  220.         member(89).text = string(gList3Quant & "x")
  221.         member(91).text = gList3Prod
  222.         member(158).text = string("¬£" & gList3Total)
  223.       end if
  224.       if gList4Quant = 0 then
  225.         member(159).text = string(EMPTY)
  226.         member(160).text = EMPTY
  227.         member(162).text = string(EMPTY)
  228.         sprite(71).visible = 1
  229.       else
  230.         member(159).text = string(gList4Quant & "x")
  231.         member(160).text = gList4Prod
  232.         member(162).text = string("¬£" & gList4Total)
  233.       end if
  234.       member(73).text = string("¬£" & gTotalCost)
  235.       gQuantity1 = gList1Quant
  236.       gQuantityTotal1 = gList1Quant
  237.       gCost1 = 0
  238.       member(69).text = string(gList1Quant)
  239.       gQuantity2 = gList2Quant
  240.       gQuantityTotal2 = gList2Quant
  241.       gCost2 = 0
  242.       member(70).text = string(gQuantity2)
  243.       gQuantity3 = gList3Quant
  244.       gQuantityTotal3 = gList3Quant
  245.       gCost3 = 0
  246.       member(71).text = string(gQuantity3)
  247.       gQuantity4 = gList4Quant
  248.       gQuantityTotal4 = gList4Quant
  249.       gCost4 = 0
  250.       member(81).text = string(gQuantity4)
  251.     end if
  252.   end if
  253. end
  254.